<?php
$installer = $this;
$installer->startSetup();
$installer->run("
        DROP TABLE IF EXISTS `events_couponlog`;
        CREATE TABLE IF NOT EXISTS `events_couponlog` (
          `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
          `coupon_id` int(11) unsigned NOT NULL COMMENT '优惠券ID',
          `events_code` varchar(64)  NULL COMMENT '活动code',
          `email` varchar(64) NOT NULL COMMENT '绑定邮箱',
          `create_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
          PRIMARY KEY (`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
    ");
$installer->endSetup();